package com.example.joke.custom

import android.content.Intent
import com.example.joke.base.navigationbar.AbsNavigationBar
import com.example.joke.custom.textview.CustomTextViewActivity
import com.example.joke.databinding.ActivityWidthHeightBinding
import com.example.joke.frame.BaseSkinActivity
import com.example.joke.frame.DefaultNavigationBar

class WidthHeightActivity : BaseSkinActivity<ActivityWidthHeightBinding>() {

    override fun setListener() {
        binding.tvNext.setOnClickListener {
            startActivity(Intent(this, CustomTextViewActivity::class.java))
        }
    }

    override fun initData() {
        binding.tvOncreate.text = "height---onCreate---".plus(binding.tv.measuredHeight)
        binding.tv.post {
            binding.tvOncreatePost.text = "height---onCreatePost---".plus(binding.tv.measuredHeight)
        }
    }

    override fun onResume() {
        super.onResume()
        binding.tvOnresume.text = "height---onResume---".plus(binding.tv.measuredHeight)

    }

    override fun initTitle() {
        DefaultNavigationBar.Builder(this)
            .setTitle("view在不同生命周期中宽高获取")
            .builder<AbsNavigationBar.Builder.AbsNavigationParams>()
    }

    override fun getBinding1(): ActivityWidthHeightBinding {
        return ActivityWidthHeightBinding.inflate(layoutInflater)
    }
}